package chai.ning.classes;

public class ClassTest2 {
	
	class Inner {
		// 还没有讲到内部类，这个只是对比 name 和 canonicalName
	}
	
	public static void main(String[] args) {
		
		Object o = new Object();
		
		Class<?> c = o.getClass();
		
		System.out.println( "simple name : " + c.getSimpleName() );
		System.out.println( "name : " + c.getName() );
		System.out.println( "canonical name : " + c.getCanonicalName() );
		
		System.out.println( "- - - - - - - - - - - - - - -" );
		
		Class<?> x = Inner.class ;
		
		System.out.println( "simple name : " + x.getSimpleName() );
		System.out.println( "name : " + x.getName() );
		System.out.println( "canonical name : " + x.getCanonicalName() );
		
		System.out.println( "- - - - - - - - - - - - - - -" );
		
		Package p = x.getPackage();
		System.out.println( p.getName() );
		
	}

}
